package com.project.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.bean.SystemInfo.RecordBean;
import com.project.mapper.IRecordMapper;
import com.project.service.IRecordService;
import com.project.service.IUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;


@Service
@Transactional
public class IRecordServiceImpl extends ServiceImpl<IRecordMapper, RecordBean> implements IRecordService {



    @Override
    public void addRecord(RecordBean recordBean) {

        this.baseMapper.insert(recordBean);

    }

    @Override
    public IPage<RecordBean> findByDate(int pageNo,int pageSize ,LocalDate startDate, LocalDate endDate) {
        Page<RecordBean> page = new Page<>(pageNo,pageSize);

        IPage<RecordBean> recordBeanIPage = this.baseMapper.findRecord(page,startDate,endDate);


        return recordBeanIPage;
    }
}
